import { createRouter, createWebHashHistory } from "vue-router";
import BasicLayout from '@/layouts/BasicLayout.vue';
const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      redirect:'/login',
    },
       {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
       {
      path: "/login",
      name: "login",
      component: () => import("@/views/Login.vue"),
    },
    {
      path: '/admin',
      component: BasicLayout,
      children: [
        {
          path: 'tenant',
          component: () => import('@/views/Admin/Tenant/Index.vue'),
          meta: { title: '租户管理' },
        },
          {
          path: 'user',
          component: () => import('@/views/Admin/User/Index.vue'),
          meta: { title: '用户管理' },
        },
          {
          path: 'role',
          component: () => import('@/views/Admin/Role/Index.vue'),
          meta: { title: '角色管理' },
        },
             {
          path: 'menu',
          component: () => import('@/views/Admin/Menu/Index.vue'),
          meta: { title: '菜单管理' },
        },
        {
          path: 'material',
          component: () => import('@/views/Admin/Material/List.vue'),
          meta: { title: '物料管理' },
        },
      ],
    },
  
    // {
    //   path: "/fundation/rbac",
    //   name: "home",
    //   redirect: 'menu',
    //   component: AdminLayout,
    //   children: [
    //     {
    //       path: "menu",
    //       component: () => import("@/views/Fundation/RBAC/Menu/index.vue"),
    //     },
    //     {
    //       path: "user",
    //       component: () => import("@/views/Fundation/RBAC/User/index.vue"),
    //     },
    //     {
    //       path: "role",
    //       component: () => import("@/views/Fundation/RBAC/Role/index.vue"),
    //     },
    //     {
    //       path: "code-smith",
    //       component: () => import("@/views/Fundation/RBAC/code-smith/index.vue"),
    //     }
    //   ]
    // }
  ],
});

export default router;